package com.itheima.com;

import java.lang.reflect.Constructor;

public class StudentDemo {
    public static void main(String[] args) throws Exception {
        Class clazz = Class.forName("com.itheima.com.Student");
        Constructor cs = clazz.getConstructor();
        Student student = (Student) cs.newInstance();
        System.out.println(student);
        Constructor cs1 = clazz.getConstructor(String.class, int.class);
        Student student1 =(Student) cs1.newInstance("张三", 19);
        System.out.println(student1);

    }
}
